import java.util.Scanner;

public class Text {
    public static void main(String[] args) {
        Scanner san = new Scanner(System.in);
        while(san.hasNextLine()){
            String a = san.nextLine();
            String[] arr = a.split(" ");
            System.out.println(arr.length);
        }
    }
}
